﻿<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"      
    xmlns:local="clr-namespace:CinchCodeGen"
    xmlns:sysIO="clr-namespace:System.IO;assembly=System"
	x:Class="CinchCodeGen.ReferencedAssembliesPopup"
	x:Name="win"
	Title="Cinch MVVM Code Generator"
    Background="{x:Null}" 
    Topmost="False" 
    WindowStartupLocation="CenterOwner" 
    WindowState="Normal"
    MinHeight="400" 
    MinWidth="600"
    Height="400"
    Width="600"
    WindowStyle="None" 
    Template="{StaticResource WindowTemplateKey}"
    ResizeMode="CanResizeWithGrip" AllowsTransparency="True">
    
    
    <Window.Resources>
        
        <!-- FileInfo -->
        <DataTemplate x:Key="fileInfoTemplate">
            <Label Content="{Binding Path=Name}"/>
        </DataTemplate>
        
    </Window.Resources>


    <Border CornerRadius="10" Background="#ff656565" BorderThickness="0">

        <Grid Background="Transparent" Margin="2">

            <Border CornerRadius="10,10,10,10" Background="White"
                BorderBrush="Black" BorderThickness="5">

                <Grid Background="#ff656565">

                    <Grid.RowDefinitions>
                        <RowDefinition Height="50"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <!-- top area-->
                    <Grid Grid.Row="0" HorizontalAlignment="Stretch" Height="50" Margin="0,0,0,0"
                      MouseLeftButtonDown="Rectangle_MouseLeftButtonDown"
                      Background="Black" >
                        <Image Source="../Images/header.png" Width="250" Height="25" Margin="10,5,5,5" 
                       HorizontalAlignment="Left" VerticalAlignment="Center"/>
                    </Grid>

                    <!-- middle area-->
                    <Grid Grid.Row="1" HorizontalAlignment="Stretch" 
                  VerticalAlignment="Stretch">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>

                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>

                        <Label FontFamily="Arial" FontSize="13" Grid.Row="0" Grid.Column="0"
                       Grid.ColumnSpan="2"
                       Content="Add / Remove Available Referenced Assemblies" Margin="5"
                       VerticalAlignment="Center" Foreground="Black"
                       FontStyle="Italic" FontWeight="Bold"
                       HorizontalAlignment="Left"/>

                        <Border Background="Black" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="1"
                            Margin="10,0,10,10"
                            HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="5">

                            <ListBox x:Name="lst" 
                         Background="Transparent" BorderBrush="Transparent" Margin="5"
                         IsSynchronizedWithCurrentItem="True" 
                         ItemContainerStyle="{DynamicResource PropertyItemStyle}"
                         ItemsSource="{Binding ReferencedAssemblies}"
                         AlternationCount="2" 
                         ItemTemplate="{StaticResource fileInfoTemplate}"
                         HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                <ListBox.Resources>


                                    <Style x:Key="PropertyItemStyle" TargetType="{x:Type ListBoxItem}">
                                        <Style.Triggers>
                                            <Trigger Property="ItemsControl.AlternationIndex" Value="0">
                                                <Setter Property="Background" Value="DarkGray"/>
                                            </Trigger>
                                            <Trigger Property="ItemsControl.AlternationIndex" Value="1">
                                                <Setter Property="Background" Value="#ff808080"/>
                                            </Trigger>
                                            <Trigger Property="IsMouseOver" Value="True">
                                                <Setter Property="Background" Value="#FFEF6803"/>
                                            </Trigger>
                                        </Style.Triggers>
                                    </Style>

                                </ListBox.Resources>
                            </ListBox>
                        </Border>

                        <Border Background="Black" BorderBrush="Black" BorderThickness="1"
                        CornerRadius="5" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="1"
                        Grid.RowSpan="2" Margin="10,35,10,10">
                            <StackPanel Orientation="Vertical">

                                <Button Tag="../Images/Add.png" 
                            Width="30" Height="30"  HorizontalAlignment="Center"
                            Style="{StaticResource imageButtons}" Margin="2,4,2,4"
                            ToolTip="Add new referenced assembly"
                            Command="{Binding AddNewAssemblyCommand}"/>

                                <Button Tag="../Images/error.ico" 
                            Width="25" Height="25"  HorizontalAlignment="Center"
                            Style="{StaticResource imageButtons}" Margin="2,4,2,4"
                            ToolTip="Delete current referenced assembly"
                            Command="{Binding RemoveAssemblyCommand}"/>

                            </StackPanel>
                        </Border>

                    </Grid>

                    <!-- bottom area-->
                    <StackPanel Grid.Row="2" HorizontalAlignment="Stretch" 
                  VerticalAlignment="Stretch" Orientation="Horizontal">

                        <Button Tag="../Images/ok.png"  IsDefault="True"
                        Width="30" Height="30"  HorizontalAlignment="Left"
                        Style="{StaticResource imageButtons}" Margin="20,10,10,10"
                        ToolTip="Ok : Accept the current available Assembly list"
                        Command="{Binding CloseActivePopUpCommand}"
                        CommandParameter="True"/>

                        <Button Tag="../Images/cancel.png"  IsCancel="True"
                        Width="30" Height="30"  HorizontalAlignment="Left"
                        Style="{StaticResource imageButtons}" Margin="20,10,10,10"
                        ToolTip="Cancel : Dismiss edits to the current available Assembly list" />

                    </StackPanel>

                </Grid>

            </Border>

            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,20,0"
                                VerticalAlignment="Top" Height="Auto" Width="Auto"  >

                <Button x:Name="btnClose" FontFamily="Wingdings" Content="û" 
                RenderTransformOrigin="0.5,0.5" Margin="35,0,0,0"
                Style="{StaticResource mainWinButtons}" 
                ToolTip="Close" Click="btnClose_Click">
                    <Button.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleX="0.7" ScaleY="0.7"/>
                            <SkewTransform AngleX="0" AngleY="0"/>
                            <RotateTransform Angle="-13.184"/>
                            <TranslateTransform X="0" Y="0"/>
                        </TransformGroup>
                    </Button.RenderTransform>
                </Button>
            </StackPanel>

        </Grid>
    </Border>



</Window>